/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * retirotraslado.java
 *
 * Created on 19/09/2011, 01:06:04 AM
 */

package proyectocatalina.mantenimiento;

/**
 *
 * @author principal
 */
public class retirotraslado extends javax.swing.JInternalFrame {

    /** Creates new form retirotraslado */
    public retirotraslado() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel6 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        btnRegTrasRet = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtObservacionTrasRet = new javax.swing.JTextArea();
        jfechaTraslado = new com.toedter.calendar.JDateChooser();

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Retiro o Traslado", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 0, 204))); // NOI18N

        jLabel13.setText("Fecha:");

        jLabel14.setText("Observación:");

        btnRegTrasRet.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/paper&pencil_48.png"))); // NOI18N
        btnRegTrasRet.setText("Registrar");
        btnRegTrasRet.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnRegTrasRet.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnRegTrasRet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRegTrasRetActionPerformed(evt);
            }
        });

        txtObservacionTrasRet.setColumns(20);
        txtObservacionTrasRet.setRows(5);
        jScrollPane2.setViewportView(txtObservacionTrasRet);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addGap(14, 14, 14)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabel13)
                        .addGap(36, 36, 36)
                        .addComponent(jfechaTraslado, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addComponent(btnRegTrasRet)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jfechaTraslado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addGap(18, 18, 18))
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(btnRegTrasRet, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnRegTrasRetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegTrasRetActionPerformed
        java.util.Date utilDate = jfechaTraslado.getDate(); //fecha actual
        long lnMilisegundos = utilDate.getTime();
        java.sql.Date sqlDate = new java.sql.Date(lnMilisegundos);

        CapadeDatos.DaoTraslado trasla = new CapadeDatos.DaoTraslado();
        trasla.insertarTraslado( sqlDate, txtObservacionTrasRet.getText());
}//GEN-LAST:event_btnRegTrasRetActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRegTrasRet;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane2;
    private com.toedter.calendar.JDateChooser jfechaTraslado;
    private javax.swing.JTextArea txtObservacionTrasRet;
    // End of variables declaration//GEN-END:variables

}
